package com.cloud.shopping.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author John.zhang
 * @version Id: StartConfig, v 1.0 2020/12/28 11:11 ZhiYong Exp $
 */

@Configuration
public class StartConfig {

    /**
     * 分页拦截器(使得分页产生效果)
     *
     * @return PaginationInterceptor
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        //设置数据类型
        paginationInterceptor.setDbType(DbType.MYSQL);
        return paginationInterceptor;
    }

}
